package com.summer.campussct.controller;

import com.summer.campussct.pojo.dto.RestResult;
import com.summer.campussct.service.IVehicleAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "审核相关API")
@RestController
@RequestMapping("audit")
public class VehicleAuditController {

    @Resource
    private IVehicleAuditService vehicleAuditService;

    @ApiOperation("提交审核")
    @PutMapping("commitAudit/{id}")
    public RestResult commitAudit(@PathVariable("id") long id){
        return vehicleAuditService.commitAudit(id);
    }

    @ApiOperation("审核通过接口")
    @PutMapping("passAudit/{id}")
    public RestResult passAudit(@PathVariable("id") long id){
        return vehicleAuditService.passAudit(id);
    }

    @ApiOperation("审核驳回接口")
    @PutMapping("rejectAudit/{id}")
    public RestResult rejectAudit(@PathVariable("id") long id,
                                  @RequestParam String auditAdvice){
        return vehicleAuditService.rejectAudit(id, auditAdvice);
    }
}
